package cz.muni.fi.pv168.realestate;

/**
 * This entity represents real estate Property, it have area, type and address.
 * One property can have 1 or more Owners.
 * 
 * @author Martin Štrbák
 *
 */
public class Property {

	private Long id;
	private double area;
	private String type;	// TODO should be better to use enum
	private String address;
	
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	public double getArea() {
		return area;
	}
	
	public void setArea(double area) {
		this.area = area;
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public String getAddress() {
		return address;
	}
	
	public void setaddress(String address) {
		this.address = address;
	}

	@Override
	public int hashCode() {
		int hash = 3;
		hash = 97*hash+(this.id != null ? this.id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		
		final Property other = (Property) obj;
		if (this.id != other.id && (this.id == null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "Property: {id: "+id+"}";
	}
	
	
}
